﻿using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace BaseTool
{
    /// <summary>
    /// 写日志操作类
    /// </summary>
    public static class LogHelper
    {
        private static readonly ILog loginfo = LogManager.GetLogger("loginfo");//这里的 loginfo 和 log4net.config 里的名字要一样
        private static readonly ILog logdebug = LogManager.GetLogger("logdebug");//这里的 loginfo 和 log4net.config 里的名字要一样
        private static readonly ILog logerror = LogManager.GetLogger("logerror");//这里的 logerror 和 log4net.config 里的名字要一样
        public static void WriteInfo(string msg)
        {
            loginfo.Info(msg);
        }
        public static void WriteDebug(string msg)
        {
            logdebug.Debug(msg);
        }
        public static void WriteError(string msg, Exception ex)
        {
            logerror.Error(msg, ex);
        }
    }
}
